
import {
	mapState,
	mapMutations
} from "vuex"
import {
	getOrderList
} from "./api.js"
export default {
	data() {
		return {
			orderList: []
		}
	},
	onShow() {
		this.onShowCall();
	},
	onLoad(options) {
		
	},
	computed:{
		
	},
	methods: {
		// 获取总共的商品数量
		getTotalProductNumber(list){
			let count = 0
			for(let i =0; i < list.length; i++ ) {
				count += list[i].number;
			}
			return count;
		},
		onShowCall(){
			getOrderList().then( (res)=>{
					this.orderList = res.data
				}).catch((err) =>{})
		},
		orderDetail(item){
			uni.navigateTo({
				url: '/pages/order/orderDetail/index?orderDetalId='+ item.id 
			})
		},
		// 返回上一级
		goBack() {
			uni.navigateBack({ delta: 1 })
		},
	},

}


		
		